<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/zhuyunreg.css" />
	</head>

	<body id="login_body">
		<div class="clear_div"></div>
		<div class="login_header">

			<div class="login_logo">
				<img src="img/zhuyun/logo.jpg" />
			</div>
			<div class="login_tab-page">
				<p class="login_tab-page_tips">宝，已有账号请直接登录吧</p>
				<a href="/reg/01.html" class="login_btn">登录</a>
			</div>
		</div>
		<div class="login_main">
			<div class="login_clear w960">
				<!--左边的图-->
				<a target="_blank" class="login_banner"><img src="img/zhuyun/item_pictrue1.jpg" style="margin-top: 50px;" /></a>
				<!--右边的登陆框-->
				<div class="login_box">
					<!--右边登陆框2-->
					<div class="login_box_card">
						<div class="login_input-group">
							<input type="text" id="user" placeholder="请输入用户名" onblur="shoujihao()" class="login_input_user" />
							<p id="userError" class="login_tips"></p>
						</div>
						<!--第一个输入框-->
						<div class="login_input-group">
							<input type="text" id="phone" placeholder="请输入手机号" onblur="shoujihao()" class="login_input_tel" />
							<p id="phoneError" class="login_tips"></p>
						</div>
						<!--第二个输入框-->
						<div class="login_input-group">
							<input type="password" id="pwd" placeholder="请设置密码" onblur="yanzheng()" class="login_input_key" />
							<p id="pwdError" class="login_tips"></p>
						</div>
						<!--第三个输入框-->
						<div class="login_input-group">
							<input type="password" id="pwd2" placeholder="请确认密码" onblur="zaici()" class="login_input_key1" />
							<p id="pwdError2" class="login_tips"></p>
						</div>

						<!--第五个输入框-->
						<!--<div style="clear: both;"></div>-->
						<div class="login_input-group">
							<input type="text" id="code" placeholder="短信验证码" class="login_input_short" />
							<input type="button" class="login_msgbtn" name="" id="" value="短信验证码" />
							<p id="codeError" class="login_tips"></p>
						</div>
						<!--登陆按钮-->
						<a class="login_main-button">立即注册</a>

					</div>
				</div>
			</div>
		</div>
		<div class="login_footer">
			<div class="login_clear_div"></div>
			<p class="login_p">
				<a href="#">关于我们</a>
				<span class="bar">|</span>
				<a href="#">联系我们</a>
				<span class="bar">|</span>
				<a href="#">人才招聘</a>
				<span class="bar">|</span>
				<a href="#">广告服务</a>
				<span class="bar">|</span>
				<a href="#">友情链接</a>
				<span class="bar">|</span>
				<a href="#">销售联盟</a>
				<span class="bar">|</span>
				<a href="#">小迪社区</a>
				<span class="bar">|</span>
				<a href="#">心服务</a>
				<span class="bar">|</span>
				<a href="#">法律申明</a>
				<span class="bar">|</span>
				<a href="#">用户体验提升计划</a>
			</p>
			<p class="login_copyright">Powered by DiXinTong©2001-2013 京ICP备11010605号 © 2001-2013 DiXinTong Inc.</p>
		</div>
		<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/dengluyanzheng.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(".login_msgbtn").click(function() {
				if(shoujihao() && yanzheng() && zaici()) {
					var username = $("#user").val()
					var phone = $("#phone").val()
					var pwd = $("#pwd").val()
					$.ajax({
						type: "POST",
						url: "https://leancloud.cn:443/1.1/users",
						data: '{"username":"' + username + '","password":"' + pwd + '","mobilePhoneNumber":"' + phone + '"}',
						contentType: "application/json",
						headers: {
							"X-LC-Id": "WGpViiVcguLhSabE0AHEbHX4-gzGzoHsz",
							"X-LC-Key": "LWjXkUknhTPjaYnyXs6CVgrC"
						},
						success: function(data) {
							console.log("请求成功");
						},
						error: function(data) {
							console.log(data);
						}
					})
					$(this).attr("disabled", "disabled")
					setTimeout(function() {
						$(".login_msgbtn").removeAttr("disabled")
					}, 120000)

				} else {

				}
			})

			$(".login_main-button").click(function() {
				var code=$("#code").val()
				$.ajax({
					type: "POST",
					url: "https://api.leancloud.cn/1.1/verifyMobilePhone/"+code,
					data:'{}',
					contentType: "application/json",
					headers: {
						"X-LC-Id": "WGpViiVcguLhSabE0AHEbHX4-gzGzoHsz",
						"X-LC-Key": "LWjXkUknhTPjaYnyXs6CVgrC"
					},
					success: function(data) {
						alert("注册成功,自动跳转首页");
						location.href="zy_login.html"
					},
					error: function(data) {
						console.log(data);
					}
				})
			})
		</script>
	</body>

</html>